cask "firefox" do
  version "145.0.1"

  language "ach" do
    sha256 "fe3c369f9986ab615e895a725e712206b08db5453e47eb15e0decd831834d384"
    "ach"
  end
  language "af" do
    sha256 "156e8b2c1f6852ed1108367c05cede14f386fe993d1b0f0477b31470d89173fa"
    "af"
  end
  language "an" do
    sha256 "a9b1c2c25518c4dba9e3ad98a04a3e6559aa42de59b73afaad0add3d22e12a2f"
    "an"
  end
  language "ar" do
    sha256 "b6b7f84e935ad160d99f53e1cd9671e2d3af7d7995c3ef0c4173aeeddfa6ad25"
    "ar"
  end
  language "ast" do
    sha256 "f21f74c2a23e52a2028e427945c915f335228943b7e493c01df879c10c828bba"
    "ast"
  end
  language "az" do
    sha256 "34133a5bfd5495b75fcf665c5fee8322f1494bd09b1654d75498568992c4810e"
    "az"
  end
  language "be" do
    sha256 "1d413ef7b79cf3038872be10b49213ecf9dfcc7a816e92623d0f07de25734fcd"
    "be"
  end
  language "bg" do
    sha256 "d179c1a92a7686452366bc8947f6f792fc26679b92cd70e97530a610a3b3acad"
    "bg"
  end
  language "bn" do
    sha256 "e7e539887a9e85f289af791132f76a39b91965065ccd4872af3814edf580097d"
    "bn"
  end
  language "br" do
    sha256 "1d5208a5f6661a692e4325466903e8107333eb0e6e334e64864a02df55ddb069"
    "br"
  end
  language "bs" do
    sha256 "3492e0d9577016f592f2c3aa86e18fa51bd07b9dafb92078dd4640ccc4e70da8"
    "bs"
  end
  language "ca" do
    sha256 "a16daac6adff457198859e97be75f6aa32222f2406edc58c19dc8535cd9c5600"
    "ca"
  end
  language "cak" do
    sha256 "f0a3b8b2a047178c7d8a57e85dec2ad86d77005604de46a86f9474cd11543d09"
    "cak"
  end
  language "cs" do
    sha256 "d8c86d8bf74df9bf1fb475fec2ab02654f8241064117a6636a351573db200fc3"
    "cs"
  end
  language "cy" do
    sha256 "cd3eec1175e3aa56f60fdf0387d7e349c834e8966ddca67aea99892592c5b429"
    "cy"
  end
  language "da" do
    sha256 "64cea678dad939e8a953d57bb56f555d919763710767abee3415e539f630a5b5"
    "da"
  end
  language "de" do
    sha256 "1247da123f140b3b6c7607c0d82b34dea009d7f70f1faacb8107fe93989edf08"
    "de"
  end
  language "dsb" do
    sha256 "9a6c38f1bee7936112afc52e04488f7b55f6ddced3390d8fc0d58f1c6ed346b3"
    "dsb"
  end
  language "el" do
    sha256 "43db4b75db3ac345060929909a76fbebf7273c4f8bfe6c04a48042dd5116be70"
    "el"
  end
  language "en-CA" do
    sha256 "5f158ead18d43486b5e40f19060498d70320b38cf9670c5a9ba85180226cdcb8"
    "en-CA"
  end
  language "en-GB" do
    sha256 "b2e6f5cb40ab9c61736dad066c3f31eedeabf40940637a371bd302c47983bd03"
    "en-GB"
  end
  language "en", default: true do
    sha256 "828ccfc48534ac976dbb71113b79045cbfeab401c81298ea5b75a8dd62232484"
    "en-US"
  end
  language "eo" do
    sha256 "459b868cc0f88557702bc25ae4efeff015a55dcb1e6afe029d5fddccc99b7351"
    "eo"
  end
  language "es-AR" do
    sha256 "db0972bc9b33c658c381fc863bd28420355cebb5312cd869782493a0a37a857f"
    "es-AR"
  end
  language "es-CL" do
    sha256 "17c3213a19f5c90cb8d0489e04602b24b117a706de81ece793b7e783610baac4"
    "es-CL"
  end
  language "es-ES" do
    sha256 "ff713f2752f90d9fdc15dfbd4a07784c029060e8f9a4063cd58bcdbeb4e01dfe"
    "es-ES"
  end
  language "es-MX" do
    sha256 "6fad110854c05b3ddb771bfc1b770ded06086a0811da4c3d94b84791f96e3765"
    "es-MX"
  end
  language "et" do
    sha256 "bbd89da2b1de9065ae9254dd47a200640acccdea1ae7658cd1b6457cf8b41c60"
    "et"
  end
  language "eu" do
    sha256 "931392476cbafab68a689d676b41b18e97d6fc69b48b799052989bb3c67cf9e3"
    "eu"
  end
  language "fa" do
    sha256 "e010978420d7feb37a102a26053da31829550d79eb22dbe45d5dd20006e3fce2"
    "fa"
  end
  language "ff" do
    sha256 "f4f449481e870ea68c85cecd63ac1187d563a9296bdf75121a40acae4348864c"
    "ff"
  end
  language "fi" do
    sha256 "370e9324f828a0e2192684f810275c462fcfc054a1824e5f80272e061eef1ce0"
    "fi"
  end
  language "fr" do
    sha256 "e64e860765062691a7767624ad090832c1a536047800d91d1edadb04b464bd98"
    "fr"
  end
  language "fur" do
    sha256 "9cdcdc4fc5db8833c58fbcd6952c8478737ca550615366eae9cadd965f05036d"
    "fur"
  end
  language "fy" do
    sha256 "d10e3ec4a00e45543cc0cbfd41a6d6e5b4b472b54f14fc0e50a93fc1352b92e3"
    "fy-NL"
  end
  language "ga" do
    sha256 "4db7246bf8460430392406736e98518cfd22933c89538b04876213d5f5b7a813"
    "ga-IE"
  end
  language "gd" do
    sha256 "89245ac362f3cc71d272ab6358d98f736ee9f24021138275c7e4ee33f8c4c3c1"
    "gd"
  end
  language "gl" do
    sha256 "a4a984dd0e27d78d7445948fe55bfec459be680f3705e9b9e436645c34f24311"
    "gl"
  end
  language "gn" do
    sha256 "cbc93e10ae5834406c308be93226c517f9b1ed7b6b7fbf03d8556807f0d5e047"
    "gn"
  end
  language "gu" do
    sha256 "df5fdc22b0b76c733137f75c67383a46cc52c719c5d4068b1ade91c7f2ab3a6d"
    "gu-IN"
  end
  language "he" do
    sha256 "3cc9ac3a7b19ac6486b6b500648dde38afbe3781cbc224421c72055e604908cb"
    "he"
  end
  language "hi" do
    sha256 "3e278c6e60a1f079978d864b3f2627618dcf04d0c3c15c6e89fd97c74176e271"
    "hi-IN"
  end
  language "hr" do
    sha256 "48c444dcb6741226c82a5f62ef577d882439a747a79607962d2436c5f1a45a57"
    "hr"
  end
  language "hsb" do
    sha256 "7078c759c89ea21ae64af50b045a62bcb33b80a76ed0ec3cbedd4b014e935429"
    "hsb"
  end
  language "hu" do
    sha256 "a73a3c17f9549d6c1e6143819adbcb60375e27d8587c4b4330eea7deee4ce816"
    "hu"
  end
  language "hy" do
    sha256 "ab960128d421097f1d7cfcf8451e2dae316efe0c4a349c269948a8c0f325482f"
    "hy-AM"
  end
  language "ia" do
    sha256 "c3961e0a9ed271c80cac2300e49f9702c56d1c1a1326d43214d66b5d6d89002a"
    "ia"
  end
  language "id" do
    sha256 "2dfbd7f2f7240bdadb7e2070badd600c73753a8bd65018b3eaa3d6400d178c39"
    "id"
  end
  language "in" do
    sha256 "3e278c6e60a1f079978d864b3f2627618dcf04d0c3c15c6e89fd97c74176e271"
    "hi-IN"
  end
  language "is" do
    sha256 "7a55cec54f6bf26b9328b71d6c0d17dda5b14365a0fa4c641e9327df04675968"
    "is"
  end
  language "it" do
    sha256 "743ceb126dc622c896142355c68e12184137449739ea01a1c7de17dc2783ca1c"
    "it"
  end
  language "ja" do
    sha256 "e64d3000c34d2af26aee9a88e061fb33887dda64ebf77548c6a784a418063714"
    "ja-JP-mac"
  end
  language "ka" do
    sha256 "49bc38d67f098b7a871c342364c19045f8abfdbea1e2364ecf2ecb19e619ca92"
    "ka"
  end
  language "kab" do
    sha256 "7d1b92d92252779e932d162ccb3ea11bb021d8d56b871f4e582968b50366fc42"
    "kab"
  end
  language "kk" do
    sha256 "f859cd22ad43a4734843ff9fefc5b4db99cd10b989c55db15a174051c7da09dd"
    "kk"
  end
  language "km" do
    sha256 "7e4df1f57aa31e5c6e34cfc259f69361e28ba22e41ca88ede3478ee197a47564"
    "km"
  end
  language "kn" do
    sha256 "d111836b43786815ab6bcae3a6c0bc20f18fd7398f68331d7fc22613f6f47525"
    "kn"
  end
  language "ko" do
    sha256 "4a5f62b1d39609e7326ec8827ef21efedab82187b2c5ab0ff370cf771792f4f2"
    "ko"
  end
  language "lij" do
    sha256 "2130a0b5541c5fd5ecf40092131f5a343de58c5e4dc1b6794c8fedd30363e274"
    "lij"
  end
  language "lt" do
    sha256 "1878f9c4d98a0b61415dcc0c1609ce31b41e11c1e28519031ccea60e65f7c5d5"
    "lt"
  end
  language "lv" do
    sha256 "ef7d2727c5d8da6d74cee9cfed618e55dee378a2b23173239216e1727c45b80c"
    "lv"
  end
  language "mk" do
    sha256 "99074bffa5f9b1d7cc9cc62633838a1dc1e39eda13c178219d1211cfd75c3a7f"
    "mk"
  end
  language "mr" do
    sha256 "798db48b43f8fe8510e82aa736cb7814f3c8f3d48b0dd8aa762f8bfd2e3e5725"
    "mr"
  end
  language "ms" do
    sha256 "aed5a268564a919af073e71ddf36a434e2e07822aa20462187487469e18c5fd8"
    "ms"
  end
  language "my" do
    sha256 "74f7f1bd7c24f8f4e5327bc132572f1e172f585226cc7572e95e9091e25a7fb3"
    "my"
  end
  language "nb" do
    sha256 "2bacd5c23eb7e41fdaaecf27587284d7d1ab64e32e3f5778805bb683dc9913bc"
    "nb-NO"
  end
  language "ne" do
    sha256 "6b6a42679253b7b5d62f61fe86b43b56d14b1d716b2d862acb4706b69c72f897"
    "ne-NP"
  end
  language "nl" do
    sha256 "a742290386948a032d1d43e8645a84d96830549528bb878d6ffcaef3805495d6"
    "nl"
  end
  language "nn" do
    sha256 "0b59e4255a2f7dcbfda2ecd5826de60b827a93663841564d70835a08bea94979"
    "nn-NO"
  end
  language "oc" do
    sha256 "3adbcfe8ca5e64cddbdabe13f2f2664f12403941abc574a1f910a1c9727cb595"
    "oc"
  end
  language "pa-IN" do
    sha256 "5052cf09847e9c20afe762a8c33f4ef694c8d2fb30bfe1a321c835ca86429081"
    "pa-IN"
  end
  language "pl" do
    sha256 "9aac2d159e87aa63210cd730d1d0fc927c2fd2282e379f0d4839872b22a451ae"
    "pl"
  end
  language "pt-BR" do
    sha256 "b1c09fd4932aa881ac499ec2257028b859270248ca47b3cd8c23b866db74cf2a"
    "pt-BR"
  end
  language "pt" do
    sha256 "c2d2446aa0e5c8beaed4ccbad4ae149c8f8dd0e7679005da8d8c9b6815ccd51d"
    "pt-PT"
  end
  language "rm" do
    sha256 "3e7b5e846029364332b8fe3dbd85e72030c03bdddd1c4b01446d57c420daa2d8"
    "rm"
  end
  language "ro" do
    sha256 "2bef2894eeee5058f7ada32bce6ac4a6b6621a7e5a3447ab1d8be294b2295807"
    "ro"
  end
  language "ru" do
    sha256 "c7237fde65b0b41e05af2364910e161818d93f73a467214705c3fa5310bda083"
    "ru"
  end
  language "sat" do
    sha256 "fa14f203ffa94737eb993b1354050d7ef901d4158141e3c09bcc7c59901d3faf"
    "sat"
  end
  language "sc" do
    sha256 "775ef8159b8c869c36cec464b73cf79490dd5df9a1d890f41ff67ea5cba0cac4"
    "sc"
  end
  language "sco" do
    sha256 "f2e4ea640f0b392376d5a65d21b9ac5705119e007c6afefeb44b108a541f718a"
    "sco"
  end
  language "si" do
    sha256 "abdb27de268811cde16511adbe5f0e1c43bfd5c1e0aa8f7569f84e0eae01a393"
    "si"
  end
  language "sk" do
    sha256 "4ee8ea743ad344be793118e97f7ae32c6c110e731391a743f08ddb28f537ea2b"
    "sk"
  end
  language "skr" do
    sha256 "820aa08298fddf3cd9deeef37fb08f80dbe0ec30538f8da6d46980e9fb2d26e0"
    "skr"
  end
  language "sl" do
    sha256 "3c51e19233b04408541681cf5c208694b2b13c76be6446cc360c68ffc96b05bc"
    "sl"
  end
  language "son" do
    sha256 "50e532ead89765f47b2c0b5bfd2933fb0e21e48c2505a9cc0d4c5479ed68c838"
    "son"
  end
  language "sq" do
    sha256 "eeb81f297c73e8ccf292718dc759338a34dc1021867699a4a50a5994dacc1f69"
    "sq"
  end
  language "sr" do
    sha256 "bd98a86e120045edfb3090221c4e2d21a87f6f08a27740eb8c0074ed8d73b8e6"
    "sr"
  end
  language "sv" do
    sha256 "68e965d10428b18b2917b5d8a3a6176cf7fde8ee9ec0bd8870b732b1a2b24966"
    "sv-SE"
  end
  language "szl" do
    sha256 "7a17b36fa730f67325d8799ea46c0d68b7f1f8b4a98f58e5e72b9f0516de22a3"
    "szl"
  end
  language "ta" do
    sha256 "0011ca3eadadf7d4a5c6d6aad8906689b9ca1921710e29e65cba298024179cc7"
    "ta"
  end
  language "te" do
    sha256 "fad7abb738d7fe2ae9786ad561f9faafdb0e06aed25d154d53df979361f3723e"
    "te"
  end
  language "tg" do
    sha256 "122b19e3217572626f569d3f53884ea0a0793ac96886979a594ac5e3f96f1f73"
    "tg"
  end
  language "th" do
    sha256 "71cc68fffeb744cb1bde24c8ed36a164a7abb4d4edbddcb9e781198b618cf967"
    "th"
  end
  language "tl" do
    sha256 "bac8d054569a056e2500dde17a445384608ce295e8914d23bbfee86166ac5327"
    "tl"
  end
  language "tr" do
    sha256 "fc544877110ad107b4621c44db4cb3f33d862b2bc1dc2aa548af87b0fa286aab"
    "tr"
  end
  language "trs" do
    sha256 "8ddb7a5c582d4ebbafd8a17c43f108cc37cd2490903f35c4337b8046f8ae851b"
    "trs"
  end
  language "uk" do
    sha256 "7db822511c233169c21eecb4583ea329c1c9ce3ec5b289436ee43fe85ae8a7b4"
    "uk"
  end
  language "ur" do
    sha256 "ad89ada02fca73f968cacd207fa5c822364576d30ffe2abdd29286750b9cbcc4"
    "ur"
  end
  language "uz" do
    sha256 "d2f8fe6c887b66da99a1a98ec5f5792efbec9b570996d016098b972bbee38286"
    "uz"
  end
  language "vi" do
    sha256 "187e7e8ad9a8056ab6b7a95e32e7f46dbd1c92cd01b98c7574452443308fcdfd"
    "vi"
  end
  language "xh" do
    sha256 "cc9d9e35737eae89633eebd0dab682af0df6a407ca32e9db7b76318e657d4b0e"
    "xh"
  end
  language "zh-TW" do
    sha256 "573462bb2a868ed7034021390557c5fd72a5d7c9fe2ccf14009b8e538abda5c7"
    "zh-TW"
  end
  language "zh" do
    sha256 "8dc403dba7c8b56e3709163773eda4a4b4a45c60c590fc68f059a1185742b64d"
    "zh-CN"
  end

  url "https://download-installer.cdn.mozilla.net/pub/firefox/releases/#{version}/mac/#{language}/Firefox%20#{version}.dmg",
      verified: "download-installer.cdn.mozilla.net/pub/firefox/releases/"
  name "Mozilla Firefox"
  desc "Web browser"
  homepage "https://www.mozilla.org/firefox/"

  livecheck do
    url "https://product-details.mozilla.org/1.0/firefox_versions.json"
    strategy :json do |json|
      json["LATEST_FIREFOX_VERSION"]
    end
  end

  auto_updates true
  conflicts_with cask: [
    "firefox@beta",
    "firefox@cn",
    "firefox@esr",
  ]

  app "Firefox.app"
  # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
  shimscript = "#{staged_path}/firefox.wrapper.sh"
  binary shimscript, target: "firefox"

  preflight do
    File.write shimscript, <<~EOS
      #!/bin/bash
      exec '#{appdir}/Firefox.app/Contents/MacOS/firefox' "$@"
    EOS
  end

  uninstall quit: "org.mozilla.firefox"

  zap trash: [
        "/Library/Logs/DiagnosticReports/firefox_*",
        "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.mozilla.firefox.sfl*",
        "~/Library/Application Support/CrashReporter/firefox_*",
        "~/Library/Application Support/Firefox",
        "~/Library/Caches/Firefox",
        "~/Library/Caches/Mozilla/updates/Applications/Firefox",
        "~/Library/Caches/org.mozilla.crashreporter",
        "~/Library/Caches/org.mozilla.firefox",
        "~/Library/Preferences/org.mozilla.crashreporter.plist",
        "~/Library/Preferences/org.mozilla.firefox.plist",
        "~/Library/Saved Application State/org.mozilla.firefox.savedState",
        "~/Library/WebKit/org.mozilla.firefox",
      ],
      rmdir: [
        "~/Library/Application Support/Mozilla", #  May also contain non-Firefox data
        "~/Library/Caches/Mozilla",
        "~/Library/Caches/Mozilla/updates",
        "~/Library/Caches/Mozilla/updates/Applications",
      ]
end
